package com.wf.day_0604.test2;

import java.util.Arrays;
import java.util.function.Supplier;

/**
 * @author mpk
 * @since 2024/6/4 15:27:04
 */
public class SupplierDemo {


    public static void main(String[] args) {

         int[] arr={1,2,3,4,5,6,7,8,9};

        int arrMax = getArrMax(() -> Arrays.stream(arr).max().getAsInt());

        System.out.println(arrMax);
    }

    private static int getArrMax(Supplier<Integer> supplier) {

        return  supplier.get();
    }

}
